package com.learn.thread;

/**
 * 线程礼让的
 */
    public class TestThreadYield implements Runnable{
    @Override
    public void run() {
        if("aaa".equals(Thread.currentThread().getName())){
            Thread.yield();
        }
        System.out.println(Thread.currentThread().getName()+"：.....start");
    }

    public static void main(String[] args) {
        TestThreadYield testThreadYield = new TestThreadYield();
        new Thread(testThreadYield,"aaa").start();
        new Thread(testThreadYield,"bbb").start();
    }
}
